<template>
  <div class="sellChart" ref="sellChart">

  </div>
</template>

<script>
  var echarts = require('echarts')
  export default {
    data() {
      return {
        data: [
          { value: 1048, name: '广州' },
          { value: 735, name: '山东' },
          { value: 580, name: '上海' },
          { value: 484, name: '北京' },
          { value: 300, name: '河南' }
        ]
      }
    },
    methods: {
      sellChart() {
        var myChart = echarts.init(this.$refs.sellChart)
        myChart.setOption({
          title: {
            text: '销售数量分布',
            subtext: '纯属虚构',
            left: 'center'
          },
          tooltip: {
            trigger: 'item'
          },
          legend: {
            top: '10%',
            left: 'left',
          },
          series: [
            {
              name: '访问来源',
              type: 'pie',
              radius: '70%',
              data:this.data,
              emphasis: {
                itemStyle: {
                  shadowBlur: 10,
                  shadowOffsetX: 0,
                  shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
              }
            }
          ]
        })
      }
    },
    mounted() {
      this.sellChart()
    },
  }

</script>
<style lang='scss' scoped>
  .sellChart{
    width: 100%;
    height: 450px;
    
  }
</style>